// cover some element-ui styles

.el-breadcrumb__inner,
.el-breadcrumb__inner a {
  font-weight: 400 !important;
}

.el-upload {
  input[type="file"] {
    display: none !important;
  }
}

.el-upload__input {
  display: none;
}

.cell {
  .el-tag {
    margin-right: 0px;
  }
}

.small-padding {
  .cell {
    padding-left: 5px;
    padding-right: 5px;
  }
}

.fixed-width {
  .el-button--mini {
    padding: 7px 10px;
    width: 60px;
  }
}

.status-col {
  .cell {
    padding: 0 10px;
    text-align: center;

    .el-tag {
      margin-right: 0px;
    }
  }
}

// to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog {
  transform: none;
  left: 0;
  position: relative;
  margin: 0 auto;
}

// refine element ui upload
.upload-container {
  .el-upload {
    width: 100%;

    .el-upload-dragger {
      width: 100%;
      height: 200px;
    }
  }
}

// dropdown
.el-dropdown-menu {
  a {
    display: block
  }
}

// fix date-picker ui bug in filter-item
.el-range-editor.el-input__inner {
  display: inline-flex !important;
}

// to fix el-date-picker css style
.el-range-separator {
  box-sizing: content-box;
}

.el-menu--collapse
  > div
  > .el-submenu
  > .el-submenu__title
  .el-submenu__icon-arrow {
  display: none;
}

// 移动端 MessageBox 弹窗样式优化
@media screen and (max-width: 768px) {
  .el-message-box {
    width: 90% !important;
    max-width: 420px;
    margin-top: 20vh;
    
    .el-message-box__header {
      padding: 15px 20px 10px;
    }
    
    .el-message-box__content {
      padding: 20px;
      font-size: 14px;
    }
    
    .el-message-box__btns {
      padding: 10px 20px 15px;
      
      button {
        font-size: 14px;
        padding: 8px 15px;
        min-width: 80px;
      }
    }
  }
  
  .el-message-box__wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}

// 移动端 DatePicker 样式优化，确保在小屏幕上完全可见
@media screen and (max-width: 768px) {
  .el-picker-panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 320px !important;
    margin: 0 !important;
    
    .el-date-picker__header {
      margin: 8px 5px;
    }
    
    .el-picker-panel__content {
      width: 100%;
      margin: 0 auto;
    }
    
    .el-date-table {
      width: 100%;
      
      td {
        padding: 0;
        height: 30px;
        
        .cell {
          height: 28px;
          line-height: 28px;
        }
      }
    }
    
    .el-date-table th {
      padding: 5px;
    }
    
    .el-time-panel {
      width: 100% !important;
      left: 0 !important;
    }
    
    .el-time-spinner {
      width: 100%;
      
      .el-scrollbar__wrap {
        padding-bottom: 0;
      }
      
      .el-time-spinner__wrapper {
        max-height: 150px;
        width: 32%;
        margin: 0 1px;
      }
      
      // 时间选择器点击区域修复
      .el-time-spinner__item {
        height: 32px;
        line-height: 32px;
      }
      
      .el-time-spinner__list .el-scrollbar__wrap,
      .el-time-spinner__list .el-scrollbar__view {
        height: auto !important;
      }
    }
    
    // 时间选择器指示线修复
    .el-time-panel__content::after,
    .el-time-panel__content::before {
      margin-top: -16px !important;
      height: 32px !important;
      z-index: -1 !important;
      pointer-events: none !important;
      border-top: 1px solid transparent !important;
      border-bottom: 1px solid transparent !important;
    }
  }
  
  .el-date-editor.el-input, 
  .el-date-editor.el-input__inner {
    width: 100% !important;
  }
}

// 彻底修复时间选择器点击区域问题
.mobile-time-fix + .el-picker-panel {
  .el-time-panel {
    .el-time-panel__content {
      &::before, &::after {
        content: '';
        position: absolute;
        z-index: 0 !important;
        left: 0;
        right: 0;
        top: 50% !important;
        height: 40px !important;
        margin-top: -20px !important;
        border-top: 1px solid transparent;
        border-bottom: 1px solid transparent;
        box-sizing: border-box;
        pointer-events: none;
      }
    }
    
    .el-time-spinner__item {
      height: 40px !important;
      line-height: 40px !important;
      position: relative;
      z-index: 1;
      cursor: pointer;
      font-size: 16px !important;
      
      &.active {
        font-size: 18px !important;
        color: #409EFF;
        font-weight: bold;
      }
    }
    
    .el-time-spinner__wrapper {
      height: 280px;
      max-height: none !important;
      overflow: auto;
    }
    
    .el-scrollbar__wrap {
      height: auto !important;
    }
  }
}

// 直接重写Element时间选择器关键样式
.el-time-panel {
  margin: 0 !important;
  
  .el-time-spinner {
    .el-time-spinner__wrapper {
      &::-webkit-scrollbar {
        display: none;
      }
    }
  }
  
  .el-time-panel__content {
    &:before, &:after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      top: 50%;
      margin-top: -20px;
      height: 40px;
      z-index: 0;
      border-top: 1px solid transparent;
      border-bottom: 1px solid transparent;
      box-sizing: border-box;
      pointer-events: none;
    }
  }
  
  .el-time-spinner__item {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    
    &.active {
      background-color: rgba(64, 158, 255, 0.15);
      font-size: 18px;
      color: #409EFF;
      font-weight: bold;
      box-shadow: 0 0 5px rgba(64, 158, 255, 0.2);
    }
  }
}